home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Computers
/
Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso
/
shareware
/
games
/
pipeline
/
pipeline_ii.asm
< prev
next >
Wrap
Assembly Source File
|
1994-11-17
|
57KB
|
2,830 lines
opt c-,d-,o1+,o2+,ow-,l+
*
* PIPELINE II
*
* Written by André Wichmann of CLUSTER in Mar-Apr 1990
*
* Concept: EMPIRE (Pipe Mania/Pipe Dream)
* MASTERTRONIC (Locomotion or something like that)
*
* This program is FREEWARE ! For further information read the doc-file !
*
* Improvements made from 14/08/90 to 22/08/90
* Last update made on 10/12/90
*
incdir "RAM:include/"
include "exec/exec_lib.i"
include "Libraries/dos_lib.i"
*** Equates
XREF _Intro Link it with 'Intro.o'
DMACONR equ $DFF002
JOY0DAT equ $DFF00A
JOY1DAT equ $DFF00C
BLTCON0 equ $DFF040
BLTCON1 equ $DFF042
BLTAFWM equ $DFF044
BLTALWM equ $DFF046
BLTCPTH equ $DFF048
BLTBPTH equ $DFF04C
BLTAPTH equ $DFF050
BLTDPTH equ $DFF054
BLTSIZE equ $DFF058
BLTCMOD equ $DFF060
BLTBMOD equ $DFF062
BLTAMOD equ $DFF064
BLTDMOD equ $DFF066
DIWSTRT equ $DFF08E
DIWSTOP equ $DFF090
DDFSTRT equ $DFF092
DDFSTOP equ $DFF094
BPL1PTH equ $DFF0E0
BPL1PTL equ $DFF0E2
BPL2PTH equ $DFF0E4
BPL2PTL equ $DFF0E6
BPL3PTH equ $DFF0E8
BPL3PTL equ $DFF0EA
BPL4PTH equ $DFF0EC
BPL4PTL equ $DFF0EE
BPL5PTH equ $DFF0F0
BPL5PTL equ $DFF0F2
BPL6PTH equ $DFF0F4
BPL6PTL equ $DFF0F6
BPL1MOD equ $DFF108
BPL2MOD equ $DFF10A
BPLCON0 equ $DFF100
BPLCON1 equ $DFF102
BPLCON2 equ $DFF104
DMACONW equ $DFF096
DMACON equ $DFF096
COLOR00 equ $DFF180
VHPOSR equ $DFF006
CIAAPRA equ $BFE001
STARTLIST equ 38
COP1LC equ $DFF080
COPJMP1 equ $DFF088
SPR0DAT equ $DFF144
CHIP equ $10002
Planesize equ 256*40
Planes equ 5
CLsize equ 1000*4
*** Macros
ALLOC MACRO
move.l #\1,d0
move.l #\2,d1
CALLEXEC AllocMem
ENDM
FREE MACRO
move.l \1,a1
move.l #\2,d0
CALLEXEC FreeMem
ENDM
MPRINT MACRO
move.l #1,Text_Flag
move.l #3,Text_Delay
move.l Plane0,a1
add.l #\1*Planesize,a1
add.l #\2+\3*40,a1
lea \4,a0
bsr Print_Text
ENDM
PRINT MACRO
move.l Plane0,a1
add.l #\1*Planesize,a1
add.l #\2+\3*40,a1
lea \4,a0
bsr Print_Text
ENDM
SECTION "Pipeline",CODE_C
***** Main *****
include "Libraries/Dosextens.i"
movem.l d0/a0,-(sp)
clr.l _WBenchMsg
sub.l a1,a1
CALLEXEC FindTask
move.l d0,a4
tst.l pr_CLI(a4)
beq _WB
movem.l (sp)+,d0/a0
bra _run
_WB lea pr_MsgPort(a4),a0
CALLEXEC WaitPort
lea pr_MsgPort(a4),a0
CALLEXEC GetMsg
move.l d0,_WBenchMsg
movem.l (sp)+,d0/a0
_run jsr _Intro
bsr _main
move.l d0,-(sp)
tst.l _WBenchMsg
beq _Exit
CALLEXEC Forbid
move.l _WBenchMsg(pc),a1
CALLEXEC ReplyMsg
_Exit move.l (sp)+,d0
rts
_WBenchMsg ds.l 1
_Main bsr OpenLibs
sub.l a1,a1
CALLEXEC FindTask
move.l d0,a0
move.l pr_WindowPtr(a0),OldWindow
move.l #-1,pr_WindowPtr(a0)
ALLOC Planesize*4,CHIP
move.l d0,PlayPic
ALLOC 18*4*2*16,CHIP
move.l d0,PlayObj
ALLOC 48*2*16,CHIP
move.l d0,PlayFloat
ALLOC 512,CHIP
move.l d0,PlayFont
ALLOC 3*130*40,CHIP
move.l d0,PipeCluster
ALLOC 4*232*40,CHIP
move.l d0,PipeLogo
move.l #Filen_0,d1
move.l #1005,d2
CALLDOS Open
move.l d0,d7
move.l d7,d1
move.l PlayPic,d2
move.l #Planesize*4,d3
CALLDOS Read
move.l d7,d1
CALLDOS Close
move.l #Filen_1,d1
move.l #1005,d2
CALLDOS Open
move.l d0,d7
move.l d7,d1
move.l PlayObj,d2
move.l #18*4*2*16,d3
CALLDOS Read
move.l d7,d1
CALLDOS Close
move.l #Filen_2,d1
move.l #1005,d2
CALLDOS Open
move.l d0,d7
move.l d7,d1
move.l PlayFloat,d2
move.l #48*2*16,d3
CALLDOS Read
move.l d7,d1
CALLDOS Close
move.l #Filen_3,d1
move.l #1005,d2
CALLDOS Open
move.l d0,d7
move.l d7,d1
move.l PlayFont,d2
move.l #512,d3
CALLDOS Read
move.l d7,d1
CALLDOS Close
move.l #Filen_4,d1
move.l #1005,d2
CALLDOS Open
move.l d0,d7
move.l d7,d1
move.l PipeCluster,d2
move.l #3*130*40,d3
CALLDOS Read
move.l d7,d1
CALLDOS Close
move.l #Filen_5,d1
move.l #1005,d2
CALLDOS Open
move.l d0,d7
move.l d7,d1
move.l PipeLogo,d2
move.l #4*232*40,d3
CALLDOS Read
move.l d7,d1
CALLDOS Close
move.l #Filen_6,d1
move.l #1005,d2
CALLDOS Open
tst.l d0
beq No_Highscores
move.l d0,d7
move.l d7,d1
move.l #HOF,d2
move.l #240,d3
CALLDOS Read
move.l d7,d1
CALLDOS Close
No_Highscores move.l #200,d1
CALLDOS Delay
bset.b #1,$bfe001
jsr Start_Muzak
move.l #2,Difficulty
Title ALLOC Planesize*Planes,CHIP
move.l d0,Plane0
ALLOC CLSize,CHIP
move.l d0,CLadr
move.l d0,a0
move.l Plane0,d1
move.w #BPL1PTH-$DFF000,d3
move.w #Planes-1,d4
Make_CL move.w d3,(a0)+
addq.w #2,d3
swap d1
move.w d1,(a0)+
move.w d3,(a0)+
addq.w #2,d3
swap d1
move.w d1,(a0)+
add.l #Planesize,d1
dbra d4,Make_CL
move.w #$180,(a0)+
move.w #0,(a0)+
move.l a0,Target
move.l #$fffffffe,(a0)
CALLEXEC Forbid
move.w #%0000000111100000,DMACONW
clr.l SPR0DAT
move.l CLAdr,COP1LC
clr.w COPJMP1
move.w #$3081,DIWSTRT
move.w #$30c1,DIWSTOP
move.w #$0038,DDFSTRT
move.w #$00d0,DDFSTOP
move.w #%0101000000000000,BPLCON0
clr.w BPLCON1
clr.w BPLCON2
clr.w BPL1MOD
clr.w BPL2MOD
move.w #%1000011111011111,DMACONW
Title_Loop bsr Clear_Colors
move.l Target,a0
move.l #$fffffffe,(a0)
move.l PipeLogo,a0
move.l Plane0,a1
move.l #3,d7
Show_Logo_1 move.l a1,a2
move.l #232*40-1,d6
Show_Logo_2 move.b (a0)+,(a2)+
dbra d6,Show_Logo_2
add.l #Planesize,a1
dbra d7,Show_Logo_1
PRINT 4,0,10,HOFText
lea HOFBuffer,a0
move.l #39,d0
Clear_HOFB move.b #" ",(a0)+
dbra d0,Clear_HOFB
lea HOF,a5
move.l #42*40,d6
move.l #9,d7
Show_High move.l (a5)+,d2
movem.l d6/d7/a5,-(sp)
bsr BinDec
movem.l (sp)+,d6/d7/a5
lea HOFBuffer+4,a1
lea Dec_Buffer+1,a0
move.l #6,d0
Copy_Score move.b (a0)+,(a1)+
dbra d0,Copy_Score
move.b #" ",(a1)+
move.b #" ",(a1)+
move.b #" ",(a1)+
move.l #19,d0
Copy_Name move.b (a5)+,(a1)+
dbra d0,Copy_Name
move.b #0,(a1)+
movem.l d6/d7/a5,-(sp)
move.l Plane0,a1
add.l #4*Planesize,a1
add.l d6,a1
lea HOFBuffer,a0
bsr Print_Text
movem.l (sp)+,d6/d7/a5
add.l #16*40,d6
dbra d7,Show_High
lea TitleCols_1,a5
bsr Fade_In
move.l #8,d6
TWait1_2 move.l #$ffff,d7
TWait_1 btst #7,$BFE001
beq StartGame1
btst #6,$BFE001
beq EndGame1
dbra d7,TWait_1
dbra d6,TWait1_2
lea TitleCols_1,a5
bsr Fade_Out
bsr Clear_Colors
move.l Plane0,a1
move.l #5*Planesize-1,d0
ClearTPlanes move.b #0,(a1)+
dbra d0,ClearTPlanes
move.l Target,a0
move.w #$400f,d1
move.w #$0000,d2
move.l #15,d0
Spreadloop_1 move.w d1,(a0)+
move.w #$fffe,(a0)+
move.w #$1a0,(a0)+
move.w d2,(a0)+
add.w #$0110,d2
add.w #$0200,d1
dbra d0,Spreadloop_1
move.w #$d00f,d1
move.w #$0ff0,d2
move.l #15,d0
Spreadloop_2 move.w d1,(a0)+
move.w #$fffe,(a0)+
move.w #$1a0,(a0)+
move.w d2,(a0)+
sub.w #$0110,d2
add.w #$0200,d1
dbra d0,Spreadloop_2
move.l #$fffffffe,(a0)
move.l PipeCluster,a0
move.l Plane0,a1
add.l #40*40,a1
move.l #2,d7
Show_Logo_3 move.l a1,a2
move.l #130*40-1,d6
Show_Logo_4 move.b (a0)+,(a2)+
dbra d6,Show_Logo_4
add.l #Planesize,a1
dbra d7,Show_Logo_3
lea TitleCols_2,a5
bsr Fade_In
move.l #Scroll,Scrollptr
move.l #1,Scrflag
bsr Wait_Blt
move.w #$ffff,BLTAFWM
move.w #$ffff,BLTALWM
clr.w BLTCON1
move.w #%0000100111110000,BLTCON0
TwoLoop_1 move.l #2,d1
move.b #$ff,d2
TwoLoop_2 move.w VHPOSR,d0
lsr.w #8,d0
cmp.b d2,d0
bne TwoLoop_2
subq.l #1,d2
dbra d1,TwoLoop_2
move.l Plane0,a0
add.l #4*Planesize,a0
add.l #20*40,a0
move.l a0,BLTDPTH
add.l #1*40,a0
move.l a0,BLTAPTH
clr.w BLTAMOD
clr.w BLTDMOD
move.w #180*64+20,BLTSIZE
bsr Wait_Blt
btst #7,$BFE001
beq StartGame2
btst #6,$BFE001
beq EndGame2
subq.l #1,Scrflag
tst.l Scrflag
bne TwoLoop_1
move.l #8,Scrflag
move.l Scrollptr,a0
lea HOFBuffer,a1
move.l #39,d0
CopyLine move.b (a0)+,(a1)+
dbra d0,CopyLine
move.b #0,(a1)
move.l Plane0,a1
add.l #4*Planesize,a1
add.l #190*40,a1
lea HOFBuffer,a0
bsr Print_text
add.l #40,Scrollptr
move.l Scrollptr,a0
cmp.b #0,(a0)
bne TwoLoop_1
lea TitleCols_2,a5
bsr Fade_Out
bra Title_Loop
Wait_Blt btst #14,DMACONR
bne Wait_Blt
rts
StartGame1 lea TitleCols_1,a5
bsr Fade_Out
bra StartGame
EndGame1 lea TitleCols_1,a5